/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Acer
 */
@Entity
@Table(name = "tb_Customer", catalog = "East2West_TourAndTravel", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TbCustomer.findAll", query = "SELECT t FROM TbCustomer t"),
    @NamedQuery(name = "TbCustomer.findByCusID", query = "SELECT t FROM TbCustomer t WHERE t.cusID = :cusID"),
    @NamedQuery(name = "TbCustomer.findByCusUserName", query = "SELECT t FROM TbCustomer t WHERE t.cusUserName = :cusUserName"),
    @NamedQuery(name = "TbCustomer.findByCusPassword", query = "SELECT t FROM TbCustomer t WHERE t.cusPassword = :cusPassword"),
    @NamedQuery(name = "TbCustomer.findByCusName", query = "SELECT t FROM TbCustomer t WHERE t.cusName = :cusName"),
    @NamedQuery(name = "TbCustomer.findByCusCareer", query = "SELECT t FROM TbCustomer t WHERE t.cusCareer = :cusCareer"),
    @NamedQuery(name = "TbCustomer.findByCusEmail", query = "SELECT t FROM TbCustomer t WHERE t.cusEmail = :cusEmail"),
    @NamedQuery(name = "TbCustomer.findByCusPhone", query = "SELECT t FROM TbCustomer t WHERE t.cusPhone = :cusPhone"),
    @NamedQuery(name = "TbCustomer.findByCusMobile", query = "SELECT t FROM TbCustomer t WHERE t.cusMobile = :cusMobile"),
    @NamedQuery(name = "TbCustomer.findByCusAddress", query = "SELECT t FROM TbCustomer t WHERE t.cusAddress = :cusAddress")})
public class TbCustomer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cus_ID", nullable = false)
    private Integer cusID;
    @Column(name = "cus_UserName", length = 50)
    private String cusUserName;
    @Column(name = "cus_Password", length = 50)
    private String cusPassword;
    @Column(name = "cus_Name", length = 50)
    private String cusName;
    @Column(name = "cus_Career", length = 50)
    private String cusCareer;
    @Column(name = "cus_Email", length = 50)
    private String cusEmail;
    @Column(name = "cus_Phone", length = 50)
    private String cusPhone;
    @Column(name = "cus_Mobile", length = 50)
    private String cusMobile;
    @Column(name = "cus_Address", length = 50)
    private String cusAddress;
    @OneToMany(mappedBy = "cusID")
    private List<TbOrder> tbOrderList;

    public TbCustomer() {
    }

    public TbCustomer(Integer cusID) {
        this.cusID = cusID;
    }

    public Integer getCusID() {
        return cusID;
    }

    public void setCusID(Integer cusID) {
        this.cusID = cusID;
    }

    public String getCusUserName() {
        return cusUserName;
    }

    public void setCusUserName(String cusUserName) {
        this.cusUserName = cusUserName;
    }

    public String getCusPassword() {
        return cusPassword;
    }

    public void setCusPassword(String cusPassword) {
        this.cusPassword = cusPassword;
    }

    public String getCusName() {
        return cusName;
    }

    public void setCusName(String cusName) {
        this.cusName = cusName;
    }

    public String getCusCareer() {
        return cusCareer;
    }

    public void setCusCareer(String cusCareer) {
        this.cusCareer = cusCareer;
    }

    public String getCusEmail() {
        return cusEmail;
    }

    public void setCusEmail(String cusEmail) {
        this.cusEmail = cusEmail;
    }

    public String getCusPhone() {
        return cusPhone;
    }

    public void setCusPhone(String cusPhone) {
        this.cusPhone = cusPhone;
    }

    public String getCusMobile() {
        return cusMobile;
    }

    public void setCusMobile(String cusMobile) {
        this.cusMobile = cusMobile;
    }

    public String getCusAddress() {
        return cusAddress;
    }

    public void setCusAddress(String cusAddress) {
        this.cusAddress = cusAddress;
    }

    public List<TbOrder> getTbOrderList() {
        return tbOrderList;
    }

    public void setTbOrderList(List<TbOrder> tbOrderList) {
        this.tbOrderList = tbOrderList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cusID != null ? cusID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbCustomer)) {
            return false;
        }
        TbCustomer other = (TbCustomer) object;
        if ((this.cusID == null && other.cusID != null) || (this.cusID != null && !this.cusID.equals(other.cusID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TbCustomer[cusID=" + cusID + "]";
    }

}
